﻿{include file="public/header"}
<title>问题修改</title>
</head>
<body>

<style>
    .form-label{
        width: 26% !important;
    }
    .row{
        margin-bottom: 3% !important;
    }

</style>
<article style="    padding: 10px;">
<form>
    <div class="ch-row ch-info-form">
        <div class="flex1">标题：</div>
        <div class="flex2">
            <input type="text" class="form-control" name="product_title"  value="{$data.product_title}">
            <input type="hidden"  name="parents_id" value="0">
            <input type="hidden"  name="product_id" value="{$data.product_id}">
        </div>
    </div>
    <div class="ch-row ch-info-form">
        <div class="flex1"><button class="btn btn-primary radius" type="button"><i class="Hui-iconfont">&#xe632;</i> 提交</button></div>
    </div>
</form>
</article>

{include file="public/footer"}
<script>
    $('.radius').click(function () {
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        var src="{:Url('index/Product/ad')}?id=0";
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data:$('form').serializeArray(),
                success: function (data) {
                    var res=JSON.parse(data);
                    if(res.code==200){
                        window.parent.location.reload(); //刷新父页面
                        parent.layer.close(index);  // 关闭layer

                    }else{
                        layer.msg(res.msg,{icon: 5,time:1000});
                    }

                },

                error: function (data) {
                    console.log(data.msg);
                },

            });



    });
</script>
</body>
</html>